/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = (appInfo) => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {});

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1697681592673_2109';

  // add your middleware config here
  config.middleware = [];

  // CSRF enable false
  config.security = {
    csrf: { enable: false },
  };

  // https配置
  // https://blog.csdn.net/weixin_45086164/article/details/130054393
  // config.cluster = {
  //   https: {
  //     key: '/usr/local/nginx/ssl/www.jeyarlin.club_nginx/www.jeyarlin.club.key', // https 证书绝对目录
  //     cert: '/usr/local/nginx/ssl/www.jeyarlin.club_nginx/www.jeyarlin.club_bundle.crt', // https 证书绝对目录
  //   },
  // };
  // config.proxy = true;
  // https配置

  config.mysql = {
    app: true,
    agent: false,
    client: {
      host: 'localhost',
      port: '3306',
      user: 'root',
      password: '123456',
      database: 'egg1',
      // IDENTIFIED: 'mysql_native_password',
    },
  };

  config.sequelize = {
    dialect: 'mysql', // support: mysql, mariadb, postgres, mssql
    database: 'egg1',
    host: 'localhost',
    port: 3306,
    username: 'root',
    password: 'MyNewPass4!',
  };

  config.jwt = {
    secret: 'diySecret',
  };

  config.multipart = {
    mode: 'file',
    fileSize: '10mb',
  };

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
